package com.inlycat.entity;

import java.io.Serializable;
import java.util.Date;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;

import org.hibernate.validator.constraints.Length;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * @author jarvan4dev@163.com
 * @since 2015年8月12日下午12:12:30
 * @category 弹幕实体类
 */

// json转换的时候，用于过滤null字段
//@JsonInclude(Include.NON_NULL)
public class Barrage implements Serializable {

	private static final long serialVersionUID = 5818719339200219361L;

	/**
	 * 弹幕编号
	 */
	private Long id;

	/**
	 * 视频Id
	 */
	@NotNull(message = "{barrage.videoId.notNull}")
	private Long videoId;

	/**
	 * 视频段ID 影片由视频段组成，每段视频有一个ID
	 */
	@NotNull(message = "{barrage.ogvId.notNull}")
	private String ogvId;
	/**
	 * 播放时间 即：第多少秒出弹幕
	 */
	@NotNull(message = "{barrage.playTime.notNull}")
	private Long playTime;

	/**
	 * 选项轴时间
	 */
	@NotNull(message = "{barrage.chooseTime.notNull}")
	private Long chooseTime;
	/**
	 * 弹幕内容
	 */
	@Length(max = 30, message = "{barrage.content.length}")
	private String content;
	/**
	 * 弹幕创建时间
	 */
	@Past(message = "{barrage.createTime.past}")
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")//格式化日期
	private Date createTime;
	
	private int type;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getVideoId() {
		return videoId;
	}

	public void setVideoId(Long videoId) {
		this.videoId = videoId;
	}

	public String getOgvId() {
		return ogvId;
	}

	public void setOgvId(String ogvId) {
		this.ogvId = ogvId;
	}

	public Long getPlayTime() {
		return playTime;
	}

	public void setPlayTime(Long playTime) {
		this.playTime = playTime;
	}

	public Long getChooseTime() {
		return chooseTime;
	}

	public void setChooseTime(Long chooseTime) {
		this.chooseTime = chooseTime;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	@Override
	public String toString() {
		return "Barrage [id=" + id + ", videoId=" + videoId + ", ogvId="
				+ ogvId + ", playTime=" + playTime + ", chooseTime="
				+ chooseTime + ", content=" + content + ", createTime="
				+ createTime + "]";
	}

}
